load("//bazel:macros.bzl", "exports_files_legacy", "select_multi", "skia_cc_deps")

licenses(["notice"])

exports_files_legacy()

filegroup(
    name = "srcs",
    srcs = [
        "SkImageEncoder.cpp",
    ] + select_multi(
        {
            "//bazel/common_config_settings:jpeg_encode_codec": [
                "SkJPEGWriteUtility.cpp",
                "SkJpegEncoder.cpp",
            ],
            "//bazel/common_config_settings:png_encode_codec": ["SkPngEncoder.cpp"],
            "//bazel/common_config_settings:webp_encode_codec": ["SkWebpEncoder.cpp"],
        },
    ),
    visibility = ["//src:__pkg__"],
)

filegroup(
    name = "private_hdrs",
    srcs = [
        "SkImageEncoderFns.h",
        "SkImageEncoderPriv.h",
    ] + select({
        "//bazel/common_config_settings:jpeg_encode_codec": ["SkJPEGWriteUtility.h"],
        "//conditions:default": [],
    }),
    visibility = ["//src:__pkg__"],
)

skia_cc_deps(
    name = "deps",
    visibility = ["//src:__pkg__"],
    deps = select_multi(
        {
            "//bazel/common_config_settings:jpeg_encode_codec": ["@libjpeg_turbo"],
            "//bazel/common_config_settings:png_encode_codec": ["@libpng"],
            "//bazel/common_config_settings:webp_encode_codec": ["@libwebp"],
        },
    ),
)
